import {request, config} from 'utils'
import * as commonService from "utils/services";

const {api} = config;
const {salesDistributoRegistryApplyService} = api;
export async function query(params = {}) {
  params.apiBaseUrl = `${salesDistributoRegistryApplyService}`;
  return commonService.commonQuery(params);
}
export async function detail(id) {
  const url = `${salesDistributoRegistryApplyService}/detail/${id}`
  return request({ url: url, method: 'GET' })
}
export async function approve({auditType,id, ...params}) {
  const url = `${salesDistributoRegistryApplyService}/auditSuccess/${auditType}/${id}`
  return request({ url: url, method: 'POST', data: params })
}
export async function deny({auditType,id, ...params}) {
  const url = `${salesDistributoRegistryApplyService}/auditFail/${auditType}/${id}`
  return request({ url: url, method: 'POST', data: params })
}
export async function editDisplayName({id, ...params}) {
  const url = `${salesDistributoRegistryApplyService}/update/${id}`
  return request({ url: url, method: 'PUT', data: params })
}

